#include <iostream>
#include <string>
#include <fstream>

using namespace std;

int main(int argc, char const *argv[])
{
    fstream File_w;

    File_w.open("test.txt", ios::out);
    if (!File_w.is_open())
    {
        cout << "文件打开失败" << endl;
    }
    File_w <<"写入了一个数据";
    
    File_w.close();
    
    return 0;
}
